﻿using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Web.Mvc;

using Microsoft.IdentityModel.Claims;

namespace MvcApplication1.Controllers
{
	public class HomeController : Controller
	{
		public ActionResult Index()
		{
			ViewBag.Message = "Welcome to ASP.NET MVC!";

			var claims = new Dictionary<string, string>();

			var claimsPrincipal = Thread.CurrentPrincipal as IClaimsPrincipal;
			if (claimsPrincipal != null)
			{
				foreach (IClaimsIdentity identity in claimsPrincipal.Identities)
				{
					foreach (Claim claim in identity.Claims)
					{
						claims.Add(claim.ClaimType, claim.Value);
					}
				}
			}

			return View(claims);
		}

		public ActionResult About()
		{
			return View();
		}
	}
}
